package com.zk.atm.service.impl;

import com.bpms.common.CommonUtil;
import com.bpms.common.JdbcWorker;
import com.bpms.common.VO;
import com.bpms.eai.PackTool;
import com.bpms.esb.IService;

public class SavaDeviceType extends PackTool implements IService {

	@Override
	public VO exec(VO arg0) {
		JdbcWorker j = null;
		VO vo = new VO();
		try{
			j = new JdbcWorker();			
			vo.setAttr("TYPE_ID",arg0.getAttr("TYPE_ID"));//机器编号
			vo.setAttr("TYPE_CODE", arg0.getAttr("TYPE_CODE"));//机器
			vo.setAttr("TYPE_NAME", arg0.getAttr("TYPE_NAME"));//机器名称
			vo.setAttr("TIME_MARK", arg0.getAttr("TIME_MARK"));//时间
			vo.voType="ATM_DEVICE_TYPE";
			if(arg0.getAttr("TYPE_ID")!=null&&!arg0.getAttr("TYPE_ID").equals("")){
				//j.update(updateVO, sql);
				//j.execute("update atmp_device_type(type_code,type_name) values('"++"','')");
			}else{
				long type_id = j.getSeqValue("type_id");
				vo.setAttr("type_id",type_id+"");
			   j.insert(vo);
			}
			vo.setAttr("msg", "success");
		}catch (Exception e) {
			CommonUtil.debug("0000",e);
			vo.setAttr("msg", e.toString());
		}
		return vo;
	}

}
